package com.test.controller;

import com.test.domain.User;
import com.test.enums.Page;
import com.test.enums.Replay;
import com.test.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * UserController
 *
 * @author HY
 * 2021/05/17 9:14
 **/

@Api(tags = "用户管理接口")
@RestController
@RequestMapping("/admin/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/insert")
    @ApiOperation("添加用户")
    public Replay insert(@RequestBody User user){

        Replay replay = new Replay();

        return replay;
    };

    @PostMapping("/del")
    @ApiOperation("删除用户")
    public Replay del(@RequestBody int id){

        Replay replay = new Replay();

        return replay;
    };


    @PostMapping("/update")
    @ApiOperation("修改用户信息")
    public Replay update(@RequestBody User user){

        Replay replay = userService.update(user);

        return replay;
    };

    @GetMapping("/select")
    @ApiOperation("查询用户")
    public Replay select(@RequestParam User user,@RequestParam  Page page){

        Replay replay = userService.select(user, page);

        return replay;
    };


}
